package com.example.rabiitmq.listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class FanoutListener {

    @RabbitListener(queues = "fanout.queue1")
    public void queueListener1(String message) {
        System.out.println("队列名称fanout.queue1,收到的消息: " + message);
    }


    @RabbitListener(queues = "fanout.queue2")
    public void queueListener2(String message) {
        System.out.println("队列名称fanout.queue2,收到的消息: " + message);
    }
}